package com.cn.learn.httpclient.domain.vo;

import lombok.Data;

/**
 * @ClassName ResultVo
 * @Description 结果集对象
 * @Author JiJiang
 * @Date 2023/5/20 15:33
 * @Version 1.0
 */
@Data
public class ResultVO<T> {

    private Integer code;

    private Integer count;


    private String msg;

    private T data;


    public static <T> ResultVO<T> getResult(Integer code, Integer count, String msg, T data) {

        ResultVO<T> resultVO = new ResultVO<>();
        resultVO.setCode(code);

        resultVO.setCount(count);
        resultVO.setData(data);
        resultVO.setMsg(msg);

        return resultVO;

    }


    public static <T> ResultVO<T> getResult(T data) {
        return getResult(0, 0, "", data);
    }

}
